package org.yiqixue.accounts.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;

@Schema(
        name="Customer",
        description = "Schema 数据框架用来存储客户与账户数据"
)
public class CustomerDto {

    @Schema(
//            name="Customer 客户数据姓名字段",
            description = "客户的姓名字段，显示客户的姓名，长度5到30个字符",
            example="扎西德勒"
    )

    @NotEmpty(message="姓名不能为空")
    @Size(min=2, max=30, message="姓名长度必须在2-30个字符之间")
    private String name;

    @Schema(
            description = "Email address of the customer", example = "tutor@eazybytes.com"
    )
    @NotEmpty(message="邮箱不能为空")
    @Email(message="邮箱格式不正确")
    private String email;

    @Schema(
            description = "Mobile Number of the customer", example = "9345432123"
    )

    @NotEmpty(message="手机号不能为空")
    @Pattern(regexp="[0-9]{10}", message = "手机号必须是10位数字")
    private String mobileNumber;

    @NotEmpty(message = "账户类型不能为空")
    private String accountType;

    private AccountsDto accountsDto;

    public CustomerDto() {
    }

    public CustomerDto(String name, String mobileNumber, String email, String accountType, AccountsDto accountsDto) {
        this.name = name;
        this.mobileNumber = mobileNumber;
        this.email = email;
        this.accountType = accountType;
        this.accountsDto = accountsDto;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMobileNumber() {
        return mobileNumber;
    }

    public void setMobileNumber(String mobileNumber) {
        this.mobileNumber = mobileNumber;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAccountType() {
        return accountType;
    }

    public void setAccountType(String accountType) {
        this.accountType = accountType;
    }

    public AccountsDto getAccountsDto() {
        return accountsDto;
    }

    public void setAccountsDto(AccountsDto accountsDto) {
        this.accountsDto = accountsDto;
    }
}
